<?php
class filesList extends module {
	public $title = "Editable tree pages";
	
	public function run() {
		$availableFiles = $this->sql->getValueFromDB("SELECT file_permission FROM permissions WHERE id='".$this->user->getProperty("group")."'");
		if ($availableFiles != "") {
			$filesList = $this->sql->getArrayFromDB(
				"SELECT name, content, path, date
				FROM uploads
				WHERE id IN ($availableFiles)"
			);
			if ($filesList) {
				for ($i=0; $i<count($filesList); $i++) {
					$this->xml->file[$i] = $filesList[$i]['content'];
					$this->xml->file[$i]['name'] = $filesList[$i]['name'];
					$this->xml->file[$i]['path'] = $filesList[$i]['path'];
					$this->xml->file[$i]['date'] = $filesList[$i]['date'];
				}
			}
		}
	}

}
?>